Chris Pollett > Old Classes >
CS185c

( Print View )

Student Corner:
  [Grades Sec3]

  [Submit Sec3]

  [Class Sign Up Sec3]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Quizzes]  [Project]

Practice Exams:
  [Mid]  [Final]

                           












CS185c Fall 2009Practice Midterm 1

For the midterm you can choose to answer questions either for Android or iPhone.

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test. (e) One problem on the actual test will be about one of my HW solutions.

1. Briefly explain the difference between an emulator and a simulator.

2. Explain how to associate an object placed on a view defined in a nib file (iPhone) or an xml tag in a layout xml file (Android) with an actual object reference in the source code on the respective platforms.

3. Describe with code snippets how to get a function foo to be called when a button is clicked in the phone interface and to display an alert dialog with "Ouch!" in it when this happens.

4. Explain how to detect if the orientation of the device has changed, and how to change which view is displayed in the event of such a change.

5. What code is needed to write a warning log message "Help! I am trapped in this mobile phone!"

6. Explain how to open a file on either Android or iPhone and read all of the text data (assume it is text file) it contains. What are good methods to override for loading/saving data on the platform in question.

7. Give example SQL statements for: (a) creating a table, (b) inserting a row into a table, (c) deleting a row from a table.

8. For either iPhone or Android, give a code example of how to open an sqlite database, execute the query a select * from foo, retrieve into an array the values from the second column of each row you get back, and then close the database.

9. Briefly describe each of the four layers in the TCP/IP architecture.

10. Explain for either Android or iPhone how to display a web page in a view on the phone screen.